Convert an integer to a 2 byte hex value

Convert an integer to a 2 byte hex value.
Expected output:
1 –> 0x01
2 –> 0x02
3 –> 0x03
4 –> 0x04
5 –> 0x05
6 –> 0x06
7 –> 0x07
8 –> 0x08
9 –> 0x09
for i in range(1, 10):
    print(i, '-->', format(i, '#04x'))

Output:

1 --> 0x01
2 --> 0x02
3 --> 0x03
4 --> 0x04
5 --> 0x05
6 --> 0x06
7 --> 0x07
8 --> 0x08
9 --> 0x09